<?php
/**
 * Created by PhpStorm.
 * User: 张辉
 * Date: 2018/6/5
 * Time: 10:01
 */

namespace app\common\service\sms\lib;

use app\common\library\CommonFun;

class YunPianSms
{
    /**
     * @var string
     */
    protected $apikey = '232870dd92ded044349ee7ca28c392d9';
    protected $host = 'https://sms.yunpian.com/v2/sms/single_send.json';

    /**
     * 发送验证码短信
     * @param $mobile string 手机号
     * @param $content string 发送内容
     * @param $ext  string 发送签名
     * @return mixed
     */
    public function send_code( $mobile = '', $content ){

        $params = array(
            'apikey'  =>  $this->apikey,
            'mobile'  =>  $mobile,
            'text'    =>  $content,
        );

        $res = CommonFun::vcurl( $this->host, $params );
        return json_decode( $res, true );
    }

}